import networkx as nx
import numpy as np
import matplotlib.pyplot as plt

paths=[
    (1,2,50),(2,5,40),(5,6,70),(2,4,65),(4,5,50)
    ,(4,6,30),(4,7,42),(4,3,52),(3,7,45),(1,3,60)
]
G=nx.Graph()
G.add_weighted_edges_from(paths)
mst=nx.maximum_spanning_tree(G)
mst_edges=list(nx.minimum_spanning_edges(G,weight="weight",algorithm="kruskal"))
print(mst_edges)
nx.draw(mst)
plt.show()